﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VNPT.DoiSoat
{
    public partial class fSelectPage : DevExpress.XtraEditors.XtraForm
    {
        public fSelectPage()
        {
            InitializeComponent();
            this.Shown += (a, e) =>
            {
                if (_u!=null)
                {
                    _u.Dock = System.Windows.Forms.DockStyle.Fill;
                    _u.Location = new System.Drawing.Point(0, 0);
                    this.Controls.Add(this._u);
                    _u.LoadSetting();
                }
                if (!string.IsNullOrWhiteSpace(_textHeader))
                {
                    this.Text = _textHeader;
                }
            };
            this.FormClosing += (a, e) =>
                {
                    if (_u != null)
                    {
                        _u.SaveSetting();
                    }
                };
        }
        Core.uBase _u;
        string _textHeader;
        public fSelectPage(Core.uBase u, string textHeader)
            : this()
        {
            _textHeader = textHeader;
            _u = u;
        }
    }
}
